package com.reservation.test;

import com.reservation.mapper.AdminHomeMapper;
import com.reservation.mapper.AdminManageMapper;
import com.reservation.service.AdminManageService;
import com.reservation.vo.admin.home.GetSystemInfo;
import com.reservation.vo.admin.rmanageuser.UserList;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
public class AdminManage {

    @Autowired
    private AdminManageMapper adminManageMapper;

    @Test
    public void test() {

        List<UserList> list = adminManageMapper.getUserList();
        list.forEach(user -> {
            switch (user.getRole()) {
                case "ADMIN":
                    user.setRole("管理员");
                    break;
                case "USER":
                    user.setRole("用户");
                    break;
                case "STAFF":
                    user.setRole("员工");
                    break;
            }
            switch (user.getStatus()) {
                case "0":
                    user.setStatus("待审核");
                    break;
                case "1":
                    user.setStatus("正常");
                    break;
                case "2":
                    user.setStatus("已冻结");
                    break;

            }

        });
        String  userId = "1";
        list.removeIf(user -> user.getId().equals(userId));
        System.out.println("------------------------------------------------------------");
        list.forEach(System.out::println);
        System.out.println("------------------------------------------------------------");
    }
}
